package com.pro.common.api.user.task.model.request;

import com.baomidou.mybatisplus.annotation.TableField;
import com.pro.common.api.user.task.enums.EnumUserTaskStatus;
import com.pro.common.api.user.task.model.base.IUserTaskStepNotify;
import com.pro.common.api.user.task.model.dto.UserTaskStepCreateDTO;
import com.pro.common.api.user.task.model.dto.UserTaskStepCallNotifyDTO;
import com.pro.framework.javatodb.annotation.JTDField;
import com.pro.framework.javatodb.constant.JTDConst;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@Schema(description = "步骤完成请求")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserTaskStepSubmitRequest implements IUserTaskStepNotify {

    @Schema(description = "步骤ID")
    private Long id;

    @Schema(description = "步骤状态")
    private EnumUserTaskStatus status;

    @Schema(description = "步骤输出信息(JSON)，用于生成下一步的初始输入")
    @JTDField(type = JTDConst.EnumFieldType.text)
    private String outputInfo;

    @Schema(description = "失败原因")
    @JTDField(mainLength = 500)
    private String errorMsg;

    @Schema(description = "步骤")
    @TableField(exist = false)
    private List<UserTaskStepCallNotifyDTO> userTaskStepCalls = new ArrayList<>();

    @Schema(description = "下一步骤")
    @TableField(exist = false)
    private UserTaskStepCreateDTO nextStep;

}

